<?php

namespace App\Modules\Admin\Controllers;



use App\Models\Replies;
use App\Models\Topics;

class TopicsController extends Controller
{
    public function index()
    {
        $topics = Topics::with(['replies','user','category'])->orderBy('created_at')->paginate(20);
        return view('admin::topics',['topics' => $topics]);
    }

    public function replies()
    {
        $replies = Replies::with(['user','topic'])->orderBy('created_at','desc')->paginate(20);
        return view('admin::replies',['replies' => $replies]);
    }
}
